<template>
	<view>
		<u-navbar :safeAreaInsetTop="false">
			<view class="u-nav-slot" slot="left">
				<image src="/static/images/back_three.svg" class="icons" @click="goback"></image>
			</view>
			<view class="u-nav-slot" slot="center">
				<view class="nav-title">收 藏</view>
			</view>
			<view class="u-nav-slot" slot="right">
				<image src="/static/images/search.png" class="icons" @click="search()"></image>
			</view>
		</u-navbar>
		<view style="position: relative;padding:120rpx 30rpx 140rpx 30rpx">
			<view v-if="list.length>0">
			<view v-for="item,index in list" class="item col" :key="index">
				<view class="row-between-center">
					<view class="title singe-line">
						{{item.workTitle}}
					</view>
					
					<view class="star-shadow">
							<image src="/static/images/collect_white.png" class="star"></image>
					</view>
				
				</view>
				<image class="img" :src="item.coverPics[0]"></image>
				<view class="row-between-center" style="margin-top: 10rpx;">
					<view class="update">更新至:#11章节名称</view>
					<view class="count">人气 {{item.viewNum}}</view>
				</view>
			</view>
			</view>
			<view class="col-center no-data" v-else>
				暂无收藏
			</view>
		</view>
	</view>
</template>

<script>
	import titlebar from '@/pages/common/titlebar.vue'
	import {
		getCollect,
	} from '@/api/change/index.js'
	export default {
		components: {
			titlebar
		},
		data() {
			return {
				showManage: false,
				showSearch: false,
				list: [],
				keyword: ''
			}
		},

		onLoad() {

		},
		mounted() {
			this.getData()
		},
		methods: {
			goback() {
				uni.navigateBack()
			},
			getData() {
				getCollect({
					keyword: this.keyword
				}).then(res => {
					this.list = res.rows
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.icons {
		width: 50rpx;
		height: 50rpx;
	}

	.nav-title {
		color: rgba(16, 16, 16, 1);
		font-size: 40rpx;
		text-align: center;
		font-weight: bolder;
	}

	.no-data {
		height: 80vh;
		color: #9a9a9a;
		font-size: 40rpx;
		font-weight: bold;
	}

	.item {
		padding: 20rpx 30rpx;
		border-radius: 30rpx;
		background-color: rgba(255, 255, 255, 1);
		color: rgba(16, 16, 16, 1);
		margin-bottom: 40rpx;

		.title {
			color: rgba(16, 16, 16, 1);
			font-size: 56rpx;
			font-family: PMZDBiaoTi-regular;
			font-weight: bold;
		}

		.star {
	
			width: 60rpx;
			height: 60rpx;
		}
		.star-shadow{
						// box-shadow: 2px 2px 20px 2px black;
						                filter: drop-shadow(0 0 8px rgba(0,0,0,.5));
		}
		.img {
			margin-top: 10rpx;
			width: 100%;
			height: 360rpx;
			border-radius: 10px;
		}

		.update {
			color: rgba(16, 16, 16, 1);
			font-size: 32rpx;
		}

		.count {
			color: rgba(16, 16, 16, 1);
			font-size: 36rpx;
		}

		.book {
			flex-shrink: 0;
			background-color: red;
			width: 200rpx;
			height: 240rpx;
			border-radius: 20rpx;
		}

		.book-title {
			color: rgba(0, 0, 0, 1);
			font-size: 40rpx;
		}

		.book-category {
			margin-top: 10rpx;
			color: rgba(0, 0, 0, 1);
			font-size: 40rpx;
			font-weight: bold;
		}

		.book-time {
			margin-top: 80rpx;
			color: rgba(16, 16, 16, 1);
			font-size: 32rpx;
		}
	}
</style>